package com.paw.hys.sa.client.fallback.factory;

import com.paw.hys.sa.client.ServiceHbClient;
import com.paw.hys.sa.client.fallback.impl.ServiceHbClientFallbackImpl;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.apache.logging.log4j.ThreadContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author lvzihai
 * @date 2022/9/15
 **/
@Slf4j
@Component
public class ServiceHbClientFallbackFactory2 implements FallbackFactory<ServiceHbClient> {

  @Autowired
  ServiceHbClientFallbackImpl serviceHbClientFallback;

  @Override
  public ServiceHbClient create (Throwable e) {
    log.error("ServiceHbClientFallbackFactory2 error",e);
    return serviceHbClientFallback;
  }

}
